// JavaScript Document

function Node(tagName, attAndVal, innerHTML){
	var newNode = document.createElement(tagName);
	if(innerHTML != null){
		newNode.innerHTML = innerHTML;	
	}
	var n = attAndVal.length;
	for(var i = 0; i<n; i++){
		newNode.setAttribute(attAndVal[i++], attAndVal[i]);		
	}
	return newNode;
}

function appendNodes(parent, children, from, to){
	if(from == null){
		from = 0;	
	}
	if(to == null){
		to = children.length-1;	
	}
	for(var i = from; i<=to; i++){
		parent.appendChild(children[i]);	
	}
}

function getSelectedTextFromSelect(selectElement){
	return selectElement.options[selectElement.selectedIndex].text;
}